package org.ecloud.biz.secret.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import org.ecloud.biz.secret.mapper.SecretMapper;
import org.ecloud.biz.secret.model.SecretPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class SecretQueryService {
	
	@Autowired
	private SecretMapper mapper;
	
	public void query(PageQuery<SecretPo> pageQuery){
		mapper.templatePage(pageQuery);
	}

	public List<SecretPo> findAll(){
        return mapper.all();
	}

    public SecretPo get(Long id){
    	return mapper.unique(id);
    }
    
    public SecretPo getByKey(String key){
    	return mapper.getByKey(key);
    }
    
    public SecretPo getBySecret(String secret){
    	return mapper.getBySecret(secret);
    }

	public SecretPo getByKeySecret(String key, String secret){
		return mapper.getByKeySecret(key, secret);
	}

}
